using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace DiscuzRobot
{
    public partial class fmPostedData : Form
    {
        List<PostedInfo> datalist;
        List<PostedInfo> data;
        public List<PostedInfo> Data
        {
            get { return data; }
            set { data = value; }
        }
        public fmPostedData(List<PostedInfo> datalist)
        {
            InitializeComponent();
            this.datalist = datalist;
        }
        private void fmHuitieData_Load(object sender, EventArgs e)
        {
            foreach (PostedInfo s in datalist)
            {
                ListViewItem lv=new ListViewItem(s.filename);
                lv.Tag=s;
                this.listView3.Items.Add(lv);
            }
        }

        private void button1_Click(object sender, EventArgs e)
        {
            data = new List<PostedInfo>();
            for (int i = 0; i < this.listView3.CheckedItems.Count; i++)
            {
                data.Add(this.listView3.Items[i].Tag as PostedInfo);
            }
            this.DialogResult = DialogResult.OK;
        }

        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }

        private void checkBox1_CheckedChanged(object sender, EventArgs e)
        {
            Global.SelectListViewAll(ref this.checkBox1, ref this.listView3);

        }
    }
}